package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.KingTravelTripMapper;
import com.ly.heart.domain.KingTravelTripEntity;
import com.ly.heart.service.IKingTravelTripService;
import javax.annotation.Resource;

/**
 * 差旅费报销单的行程单Service业务层处理
 * 
 * @author wutao
 * @date 2024-08-23
 */
@Service
public class KingTravelTripServiceImpl extends ServiceImpl<KingTravelTripMapper,KingTravelTripEntity> implements IKingTravelTripService {

    @Resource
    private KingTravelTripMapper kingTravelTripEntityMapper;

    /**
     * 查询差旅费报销单的行程单
     * 
     * @param id 差旅费报销单的行程单ID
     * @return 差旅费报销单的行程单
     */
    @Override
    public KingTravelTripEntity selectKingTravelTripEntityById(String id)
    {
        return kingTravelTripEntityMapper.selectKingTravelTripEntityById(id);
    }

    /**
     * 查询差旅费报销单的行程单列表
     * 
     * @param kingTravelTripEntity 差旅费报销单的行程单
     * @return 差旅费报销单的行程单
     */
    @Override
    public List<KingTravelTripEntity> selectKingTravelTripEntityList(KingTravelTripEntity kingTravelTripEntity)
    {
        return kingTravelTripEntityMapper.selectKingTravelTripEntityList(kingTravelTripEntity);
    }

    /**
     * 新增差旅费报销单的行程单
     * 
     * @param kingTravelTripEntity 差旅费报销单的行程单
     * @return 结果
     */
    @Override
    public int insertKingTravelTripEntity(KingTravelTripEntity kingTravelTripEntity)
    {
        kingTravelTripEntity.setCreateTime(DateUtils.getNowDate());
        return kingTravelTripEntityMapper.insertKingTravelTripEntity(kingTravelTripEntity);
    }

    /**
     * 修改差旅费报销单的行程单
     * 
     * @param kingTravelTripEntity 差旅费报销单的行程单
     * @return 结果
     */
    @Override
    public int updateKingTravelTripEntity(KingTravelTripEntity kingTravelTripEntity)
    {
        kingTravelTripEntity.setUpdateTime(DateUtils.getNowDate());
        return kingTravelTripEntityMapper.updateKingTravelTripEntity(kingTravelTripEntity);
    }

    /**
     * 批量删除差旅费报销单的行程单
     * 
     * @param ids 需要删除的差旅费报销单的行程单ID
     * @return 结果
     */
    @Override
    public int deleteKingTravelTripEntityByIds(String[] ids)
    {
        return kingTravelTripEntityMapper.deleteKingTravelTripEntityByIds(ids);
    }

    /**
     * 删除差旅费报销单的行程单信息
     * 
     * @param id 差旅费报销单的行程单ID
     * @return 结果
     */
    @Override
    public int deleteKingTravelTripEntityById(String id)
    {
        return kingTravelTripEntityMapper.deleteKingTravelTripEntityById(id);
    }
}
